package com.health.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

// 点击上传按钮切换到输入上传数据界面Servlet
@WebServlet("/inputAttribute")
public class InputServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int userId = Integer.parseInt(request.getParameter("userId"));
        int attributeId = Integer.parseInt(request.getParameter("attributeId"));
        String examineDate = request.getParameter("examineDate");
        // 设置进入上传界面标志位
        request.setAttribute("userId", userId);
        request.setAttribute("attributeId", attributeId);
        request.setAttribute("examineDate", examineDate);
        request.setAttribute("openInputView", 2);
        request.getRequestDispatcher("restrictedPages/admin.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
